package mn.usi.spendcontrol.client;


import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.uibinder.client.UiHandler;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HasText;
import com.google.gwt.user.client.ui.InlineHyperlink;
import com.google.gwt.user.client.ui.Tree;
import com.google.gwt.user.client.ui.TreeItem;
import com.google.gwt.user.client.ui.Widget;

public class Action extends Composite {

	private static ActionUiBinder uiBinder = GWT.create(ActionUiBinder.class);

	interface ActionUiBinder extends UiBinder<Widget, Action> {
	}
	
	@UiField Tree tree1;
	@UiField TreeItem tree1Item;
	public Action(String action) {
		initWidget(uiBinder.createAndBindUi(this));
		
		if(action.equals("catalog")){
			
			tree1Item.setText("Catalog");
			TreeItem cat = new TreeItem();
			cat.setText("Каталог");
			
			TreeItem cat1 = new TreeItem();
			cat1.setText("Бараа үйлчилгээ");
			
				TreeItem cat2 = new TreeItem();
			cat2.setText("Тусламж");
			
			tree1Item.addItem(cat);
			tree1Item.addItem(cat1);
			tree1Item.addItem(cat2);
			tree1.addItem(tree1Item);
			
		}
		else if(action.equals("budget")){

			tree1Item.setText("Budget");
			TreeItem cat = new TreeItem();
			cat.setText("Нүүр");
			
			TreeItem cat1 = new TreeItem();
			cat1.setText("Төсвийн бүртгэл");
			
				TreeItem cat2 = new TreeItem();
			cat2.setText("Тайлан");
			
			tree1Item.addItem(cat);
			tree1Item.addItem(cat1);
			tree1Item.addItem(cat2);
			tree1.addItem(tree1Item);
		}
		
		
	}


}